package br.com.treinaweb.parte1;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.TextView;

public class Tela6 extends Activity implements OnClickListener {
  
  public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_tela6);
    
    Button btnOk = (Button) findViewById(R.id.buttonOk);
    btnOk.setOnClickListener(this);
  }

  @Override
  public void onClick(View arg0) {
    // TODO Auto-generated method stub
    TextView resposta = (TextView) findViewById(R.id.textViewResposta);
    RadioButton rbAndroid = (RadioButton) findViewById(R.id.radioButtonAndroidBasico);
    RadioButton rbJava = (RadioButton) findViewById(R.id.radioButtonJavaBasico);
    RadioButton rbCSharp = (RadioButton) findViewById(R.id.radioButtonCSharpBasico);
    
    String msg = "Curso selecionado: ";
    if(rbAndroid.isChecked())
      msg += rbAndroid.getText().toString() + " ";
    if(rbJava.isChecked())
      msg += rbJava.getText().toString() + " ";
    if(rbCSharp.isChecked())
      msg += rbCSharp.getText().toString() + " ";
    
    resposta.setText(msg);
  }

}
